package day4;

import java.util.Calendar;

/**
 * @author oldliu
 * @since 1.0
 */
public class CalenderTest5 {
    public static void main(String[] args) {
        Calendar c=Calendar.getInstance();//获得对象
        c.set(Calendar.MONTH,19);
        System.out.println(c.getTime());
        c.set(2021,4,1);
        System.out.println(c.getTime());
        c.clear();
        System.out.println(c.getTime());
        System.out.println(">>>>>>>>>>>>>>>>>>>>>");
        c=Calendar.getInstance();
        System.out.println(c.getTime());
        //日期加减
        //add,roll...
        //c.add(Calendar.DATE,50);
        c.roll(Calendar.DATE,50);
        System.out.println("五十天后："+c.getTime());
    }
}
